using System;
using System.Collections.Generic;

public class myHalfedge
{
  //Extra variable. Useful in algorithms for storing any information.
  public int e_id;
  public int flag; 
  //Link to the source vertex of this halfedge. 
  public myVertex source; 

  //Link to the face to which this halfedge belongs.
  public myFace adjacent_face; 

  //Link to the next halfedge in this face.
  public myHalfedge next;  

  //Link to the previous halfedge in this face.
  public myHalfedge prev;  

  //Link to the twin halfedge. Set to null if this halfedge on the boundary.
  public myHalfedge twin;  

  public myVertex target
  {
      get
      {
          if (next != null)
          {
              return next.source;
          }
          return null;
      }
  }

  public myHalfedge() 
  {
    e_id = 0;
    source = null;
    adjacent_face = null;
    next = null;
    prev = null;
    twin = null;
  }

  /// Retourne une copy de l'arrete
  public myHalfedge GetClone()
  {
      myHalfedge clone = new myHalfedge();
      clone.e_id = e_id;
      return clone;
  }
}
